/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.biz.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author Admin
* @date 2023-02-17
**/
@Entity
@Data
@Table(name="hj_exhaust_fan_log")
public class ExhaustFanLog implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`name`")
    @ApiModelProperty(value = "名称")
    private String name;

    @Column(name = "`exhaust_fan_id`")
    @ApiModelProperty(value = "排风柜")
    private Integer exhaustFanId;

    @Column(name = "`lab_id`")
    @ApiModelProperty(value = "实验室")
    private Integer labId;

    @Column(name = "`surface_wind_speed`")
    @ApiModelProperty(value = "面风速")
    private Float surfaceWindSpeed;

    @Column(name = "`exhaust_air_rate`")
    @ApiModelProperty(value = "排风量")
    private Float exhaustAirRate;

    @Column(name = "`message`")
    @ApiModelProperty(value = "风量信息")
    private String message;

    @Column(name = "`status`")
    @ApiModelProperty(value = "状态")
    private Integer status;

    @Column(name = "`air_volume__difference`")
    @ApiModelProperty(value = "风量差量")
    private Float airVolumeDifference;

    @Column(name = "`created_at`")
    @CreationTimestamp
    @ApiModelProperty(value = "createdAt")
    private Timestamp createdAt;

    @Column(name = "`updated_at`")
    @UpdateTimestamp
    @ApiModelProperty(value = "updatedAt")
    private Timestamp updatedAt;

    @Column(name = "`is_deleted`")
    @ApiModelProperty(value = "是否删除")
    private Integer isDeleted;

    @Column(name = "`transducer_is_open`")
    @ApiModelProperty(value = "变频器运行指示(启动：1，停止：0)")
    private Integer transducerIsOpen;

    @Column(name = "`fault_indication`")
    @ApiModelProperty(value = "故障指示")
    private Integer faultIndication;

    @Column(name = "`operating_frequency`")
    @ApiModelProperty(value = "运行频率")
    private float operatingFrequency;

    @Column(name = "`supply_voltage`")
    @ApiModelProperty(value = "电源电压")
    private float supplyVoltage;

    @Column(name = "`motor_speed`")
    @ApiModelProperty(value = "电机转速")
    private float motorSpeed;

    @Column(name = "`voc`")
    @ApiModelProperty(value = "VOC值")
    private float voc;

    public void copy(ExhaustFanLog source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
